package com.ruoyi.common.core.domain.vo;

import lombok.Data;
import java.io.Serializable;
import java.util.List;

@Data
public class DeptUserDto implements Serializable {

    private String value;
    private String id;
    private String deptId;
    private String parentId;
    private String fullId;
    private String postId;
    private String label;

    private String ancestors;

    //个人  还是  部门   角色
    private String type;
    private List<DeptUserDto> children;

    public DeptUserDto setChild(List<DeptUserDto> list){
        this.children = list;
        return this;
    }

    public static boolean isRoot(DeptUserDto dto){
        return "部门|0".equals(dto.getParentId());
    }



    public String getValue() {
        return String.format("%s|%s",id,label);
    }
}
